home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 5.3 KB | 177 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWBmpShp.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWBMPSHP_H
- #define FWBMPSHP_H
-
- #ifndef FWBNDSHP_H
- #include "FWBndShp.h"
- #endif
-
- #ifndef FWBITMAP_H
- #include "FWBitmap.h"
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CGraphicContext;
-
- //========================================================================================
- // class FW_CBitmapShape
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CBitmapShape : public FW_CBoundedShape
- {
- public:
- FW_DECLARE_CLASS
-
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
- FW_CBitmapShape(FW_PBitmap bitmap, const FW_CRect& dstRect);
- FW_CBitmapShape(FW_PBitmap bitmap, const FW_CRect& srcRect, const FW_CRect& dstRect);
-
- FW_CBitmapShape(const FW_CBitmapShape& other);
- FW_CBitmapShape(FW_CReadableStream& archive);
-
- virtual ~FW_CBitmapShape();
-
- //----------------------------------------------------------------------------------------
- // Operators
- //
- public:
- FW_CBitmapShape& operator=(const FW_CBitmapShape& other);
-
- //---------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- // ----- Rendering -----
- virtual void Render(FW_CGraphicContext& gc) const;
-
- // ----- Flatten -----
- virtual void Flatten(FW_CWritableStream& archive) const;
-
- //---------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Rendering -----
- static void RenderBitmap(FW_CGraphicContext& gc,
- FW_PBitmap bitmap,
- const FW_CRect& srcRect,
- const FW_CRect& dstRect,
- const FW_PInk& ink = FW_kNormalInk);
- static void RenderBitmap(FW_CGraphicContext& gc,
- FW_PBitmap bitmap,
- const FW_CRect& dstRect,
- const FW_PInk& ink = FW_kNormalInk);
-
- // ----- Copying -----
- virtual FW_CShape* Copy() const;
-
- // ----- Archiving -----
- static void* Read(FW_CReadableStream& archive);
-
- // ----- Geometry -----
- void SetGeometry(const FW_PBitmap& bitmap,
- const FW_CRect& srcRect,
- const FW_CRect& dstRect);
-
- void GetGeometry(FW_PBitmap& bitmap,
- FW_CRect& srcRect,
- FW_CRect& dstRect) const;
-
- void SetSourceRect(const FW_CRect& srcRect);
- void GetSourceRect(FW_CRect& srcRect) const;
-
- void SetDestinationRect(const FW_CRect& destinationRect);
- void GetDestinationRect(FW_CRect& destinationRect) const;
-
- FW_PBitmap GetBitmap() const;
- void SetBitmap(const FW_PBitmap& bitmap);
-
- //---------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- FW_CRect fSrcRect;
- FW_PBitmap fBitmap;
- };
-
- //========================================================================================
- // Inlines
- //========================================================================================
-
- //---------------------------------------------------------------------------------------
- // FW_CBitmapShape::SetSourceRect
- //---------------------------------------------------------------------------------------
-
- inline void FW_CBitmapShape::SetSourceRect(const FW_CRect& srcRect)
- {
- fSrcRect = srcRect;
- }
-
- //---------------------------------------------------------------------------------------
- // FW_CBitmapShape::GetSourceRect
- //---------------------------------------------------------------------------------------
-
- inline void FW_CBitmapShape::GetSourceRect(FW_CRect& srcRect) const
- {
- srcRect = fSrcRect;
- }
-
- //---------------------------------------------------------------------------------------
- // FW_CBitmapShape::GetDestinationRect
- //---------------------------------------------------------------------------------------
- inline void FW_CBitmapShape::GetDestinationRect(FW_CRect& dstRect) const
- {
- dstRect = fRect;
- }
-
- //---------------------------------------------------------------------------------------
- // FW_CBitmapShape::SetDestinationRect
- //---------------------------------------------------------------------------------------
-
- inline void FW_CBitmapShape::SetDestinationRect(const FW_CRect& dstRect)
- {
- fRect = dstRect;
- }
-
- //---------------------------------------------------------------------------------------
- // FW_CBitmapShape::GetBitmap
- //---------------------------------------------------------------------------------------
-
- inline FW_PBitmap FW_CBitmapShape::GetBitmap() const
- {
- return fBitmap;
- }
-
- //---------------------------------------------------------------------------------------
- // FW_CBitmapShape::SetBitmap
- //---------------------------------------------------------------------------------------
-
- inline void FW_CBitmapShape::SetBitmap(const FW_PBitmap& bitmap)
- {
- fBitmap = bitmap;
- }
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- #endif
-